<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新闻列表</title>
    <link rel="stylesheet" href="../public/css/index.css">
</head>
<body>
    <ul>
        <% news.forEach((item,index)=>{ %> 
         <li onclick="gotoDetail('<%=item.url%>')">
            <h2>
                <%= item.title %> 
            </h2>
            
            <div class='imgs'>
                <% if(item.thumbnail_pic_s02 && item.thumbnail_pic_s03){ %> 
                <img src="<%= item.thumbnail_pic_s%>" alt="">
                <img src="<%= item.thumbnail_pic_s02%>" alt="">
                <img src="<%= item.thumbnail_pic_s03 %>" alt="">
                <% }else if(item.thumbnail_pic_s02) {%>
                    <img style="width:49%" src="<%= item.thumbnail_pic_s%>" alt="">
                    <img style ="width:49%" src="<%= item.thumbnail_pic_s02%>" alt="">
                <%} else {%>
                    <img style="width:100%;height:300px;" src="<%= item.thumbnail_pic_s%>" alt="">
                <% } %>  
            </div>
            <div class="footer_content">
                <div class="left">
                    <span><%= item.author_name %></span>
                    <span><%= item.date%></span>
                </div>
                <div class="right">
                    <span>x</span>
                </div>
            </div>
        </li> 
    <% }) %> 
    </ul>
</body>
<!-- <script src="../public/js/jquery-3.4.1.min.js"></script>
<script src="../public/js/index.js"></script> -->
<script>
    function gotoDetail(url){
        location.href = url
    }
</script>
</html>